#include "resourcetexture.h"
#include "../defines.h"

namespace gunsmith
{
CResourceTexture::CResourceTexture() : CResource(RT_TEXTURE)
{
	m_pTexture	= NULL;
}

CResourceTexture::~CResourceTexture()
{

}

/*!	\brief		Creates a texture frome the given source file.
	\param		pSource	Source filename.
	\return		bool
	\remarks	
	\sa			*/
bool CResourceTexture::Create(void *pSource)
{
	const char *cpSource = (const char*)pSource;
	return SUCCEEDED(D3DXCreateTextureFromFile(m_pDevice, cpSource, &m_pTexture));
}

void CResourceTexture::Destroy()
{
	RELEASE(m_pTexture);
}

IDirect3DTexture9* CResourceTexture::GetTexture() const
{
	return m_pTexture;
}
};